fix: add specific error message for plain permalink sites#25703
Open
mmustafasenoglu wants to merge 1 commit into
Open
fix: add specific error message for plain permalink sites#25703mmustafasenoglu wants to merge 1 commit into
mmustafasenoglu wants to merge 1 commit into
Conversation
When a self-hosted WordPress site uses plain permalinks, the REST API
root is advertised as a query-parameter form (rest_route=/) which can
cause login failures. This change detects this case and shows a specific,
actionable error message directing users to enable pretty permalinks.
Before: "Cannot load the WordPress site details"
After: "This site uses plain permalinks, which are not fully supported.
Please enable pretty permalinks in Settings > Permalinks, or
contact your hosting provider for assistance."
Fixes wordpress-mobile#25604
Signed-off-by: mustafasenoglu <mustafasenoglu@users.noreply.github.com>
Contributor
|
Thanks for the pull request. I'd prefer to support those sites properly, once Automattic/wordpress-rs#1369 lands. /cc @jkmassel |
Author
|
Thanks for the update @crazytonyli. Makes sense to wait for wordpress-rs#1369 to land first. I'll keep an eye on that and can revisit this PR once it's merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a self-hosted WordPress site uses plain permalinks, the REST API root is advertised as a query-parameter form (
rest_route=/) which causes the login to fail with a generic error message.Before: "Cannot load the WordPress site details"
After: "This site uses plain permalinks, which are not fully supported. Please enable pretty permalinks in Settings > Permalinks, or contact your hosting provider for assistance."
Changes
SignInError.plainPermalinkNotSupportedcase with a specific, actionable error messagerest_routequery parameter in the API root URLrest_routeform, the specific error is shown instead of the generic oneFiles Changed
WordPress/Classes/Login/SelfHostedSiteAuthenticator.swiftRelated Issues